
//cl1 and cl2 should be three dimensional arrays, with the inner arrays all 3 wide.
//the outer arrays represent rows and cells within those rows
unsigned FitnessFunction(unsigned hrange,unsigned vrange,unsigned* cl1, unsigned* cl2){
	unsigned i,j;
	unsigned fitness=0;
	for (i = 0;i<hrange;i++){
		for (j=0;i<vrange;j++){
			unsigned r1,g1,b1,r2,g2,b2,dr,dg,db;
			unsigned jump = (j+i*vrange)*3;
			unsigned *win1 = cl1 + jump;
			unsigned *win2 = cl2 + jump;
			r1 = *(win1);
			g1 = *(win1 + 1);
			b1 = *(win1 + 2);
			r2 = *(win2);
			g2 = *(win2 + 1);
			b2 = *(win2 + 2);
			dr = r1-r2;
			dg = g1-g2;
			db = b1-b2;
			fitness += (dr*dr)+(dg*dg)+(db*db);
		}
	}
	return fitness;
	
}

int main(){
	
}
